var t = getApp();

Page({
  data: {
    currentTab: 0,
    commList: "",
    level: 0,
    currentResult: 0,
    commBoo: !0,
    loadingBoo: !0,
    moreBoo: !0,
    requsetBoo: !0,
    commList:{
      good:10,
      middle:20,
      bad:30,
      goodDegree:10
    },
    estimates:[
      {
        phoneMask:'老王',
        estimate: '好好好',
        estimateImages: ["/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png",],
        createTime:'2018-10-26',
        itemParam:20
      },
      {
        phoneMask: '老王',
        estimate: '好好好',
        estimateImages: ["/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png",],
        createTime: '2018-10-26',
        itemParam: 20
      },
      {
        phoneMask: '老王',
        estimate: '好好好',
        estimateImages: ["/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png",],
        createTime: '2018-10-26',
        itemParam: 20
      },
      {
        phoneMask: '老王',
        estimate: '好好好',
        estimateImages: ["/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png",],
        createTime: '2018-10-26',
        itemParam: 20
      },
      {
        phoneMask: '老王',
        estimate: '好好好',
        estimateImages: ["/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png",],
        createTime: '2018-10-26',
        itemParam: 20
      },
      {
        phoneMask: '老王',
        estimate: '好好好',
        estimateImages: ["/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png",],
        createTime: '2018-10-26',
        itemParam: 20
      },
      {
        phoneMask: '老王',
        estimate: '好好好',
        estimateImages: ["/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png",],
        createTime: '2018-10-26',
        itemParam: 20
      },
      {
        phoneMask: '老王',
        estimate: '好好好',
        estimateImages: ["/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png", "/assets/images/796.png",],
        createTime: '2018-10-26',
        itemParam: 20
      }
    ]
  },
  onShareAppMessage: function() {
    return t.globalData.share;
  },
  onLoad: function (options) {
    var that = this
    var sid = options.sid
    var page = that.data.page
    that.setData({
      sid: sid
    })
    this.getAllpinglun()
  },
  getAllpinglun: function () {
    var that = this;
    var sid = that.data.sid
    t.util.request({
      'url': 'entry/wxapp/Pinglun2',
      data: {
        sid: sid
      },
      success: function (res) {
        console.log(res);
        that.setData({
          estimates: res.data,
        });
      },
      fail: function (err) {
        console.log(err)
      },
    })
  },
  swichNav: function(a) {
    wx.showLoading({
      title: "加载中...",
      mask: !0
    });
    var e = this;
    if (this.data.currentTab != a.target.dataset.current) {
      var s = a.target.dataset.current;
      this.setData({
        currentTab: a.target.dataset.current,
        level: s,
        // estimates: "",
        currentResult: 0,
        commBoo: !0,
        moreBoo: !0
      }), e.getAllpinglun()
    }
  },
  moreOrder: function() {
    // var sid = this.data.sid
    // if (this.data.requsetBoo && this.data.moreBoo) {
    //   var a = this,
    //     e = this.data.currentResult,
    //     s = this.data.estimates;
    //   e >= this.data.total ? this.setData({
    //     moreBoo: !1
    //   }) : (this.setData({
    //     loadingBoo: !1
    //   }),
    //   t.util.request({
    //     'url': 'entry/wxapp/Pinglun2',
    //     data: {
    //       sid: sid
    //     },
    //     success: function (res) {
    //       this.setData({
    //         estimates: res.data,
    //         commList: e.data,
    //         estimates: s,
    //         loadingBoo: !0,
    //         requsetBoo: !0
    //       });
    //     },
    //     fail: function (err) {
    //       console.log(err)
    //     },
    //   }), this.setData({
    //     requsetBoo: !1
    //   }));
    // }
  },
  previewImage: function(t) {
    var a = t.target.dataset.targeturl,
      e = [];
    this.data.estimates.forEach(function(t) {
      t.estimateImages && t.estimateImages.forEach(function(t) {
        e.push(t);
      });
    }), wx.previewImage({
      current: a,
      urls: e,
      success: function(t) {}
    });
  }
});